package com.zkthink.ceres.order.service.impl;

import com.zkthink.ceres.order.dao.OrderProductMapper;
import com.zkthink.ceres.order.entity.OrderProduct;
import com.zkthink.ceres.order.service.OrderProductService;
import com.zkthink.base.service.SuperServiceImpl;

import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 业务实现类
 *
 * </p>
 *
 * @author JustArgo
 * @date 2020-05-10
 */
@Slf4j
@Service
public class OrderProductServiceImpl extends SuperServiceImpl<OrderProductMapper, OrderProduct> implements OrderProductService {

  @Override
  public List<Map<String, Object>> countProductSale(Map<String, Object> param) {
    return this.baseMapper.countProductSale(param);
  }

  @Override
  public Integer queryProductCount(String orderCode) {
    if(StringUtils.isNotBlank(orderCode)){
      return baseMapper.queryProductCount(orderCode);
    }
    return 0;
  }
}
